﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            a6();
        }

        static void a1()
        {
            Console.WriteLine("请输入正方形的边长");
            int a = int.Parse(Console.ReadLine());
            for (int i = 0; i < a; i++)
            {
                for (int j = 0; j < a; j++)
                {
                    Console.Write("*");
                }
                Console.WriteLine();
            }
        }

        static void a2()
        {
            for (int q = 1; q < 10; q++)
            {
                for (int i = 1; i <= q; i++)
                {
                    Console.Write(i + "*" + q + "=" + q * i + "\t");
                }
                Console.WriteLine();
            }
        }

        static void a3()
        {
            Console.WriteLine("请输入正方形的边长");
            int a = int.Parse(Console.ReadLine());
            for (int i = 0; i < a; i++)
            {
                for (int j = 0; j < a; j++)
                {
                    if (i == 0 || i == a - 1 || j == 0 || j == a - 1)
                    {
                        Console.Write("*");
                    }
                    else
                    {
                        Console.Write(" ");
                    }
                }
                Console.WriteLine();
            }
        }

        static void a4()
        {

            for (int i = 0; i < 5; i++)
            {
                for (int j = 0; j < 5; j++)
                {
                    if (j >= 3 - i - 1 && j <= 3 + i - 1 && i < 3)
                    {
                        Console.Write("*");
                    }
                    else if (j >= 2 - (5 - (i + 1)) && j <= 2 + (5 - (i + 1)) && i >= 3)
                    {
                        Console.Write("*");
                    }
                    else
                    {
                        Console.Write(" ");
                    }
                }
                Console.WriteLine();
            }
        }

        static void a5()
        {
            int[][] arr = new int[10][];





            for (int i = 0; i < 10; i++)
            {
                arr[i] = new int[i + 1];

            }

            for (int i = 0; i < arr.GetLength(0); i++)
            {
                for (int j = 0; j < arr[i].Length; j++)
                {
                    if (j == 0)
                    {
                        arr[i][j] = 1;
                    }
                    else if (j == arr[i].Length - 1)
                    {
                        arr[i][j] = arr[i - 1][arr[i - 1].Length - 1];
                    }
                    else
                    {
                        arr[i][j] = arr[i - 1][j - 1] + arr[i - 1][j];
                    }
                }
            }

            for (int i = 0; i < arr.GetLength(0); i++)
            {

                for (int j = 0; j < arr[i].Length; j++)
                {
                    Console.Write(arr[i][j] + "  ");
                }
                Console.WriteLine();
            }







        }

        static void a6()
        {
            string[] a = new string[5];
            for (int i = 0; i < a.Length; i++)
            {
                Console.WriteLine("请输入第{0}个值",i+1);
                a[i] = Console.ReadLine();
            }
                    Console.WriteLine("下标为偶数的为");
            for (int i = 0; i < a.Length; i++)
            {
                if (i%2==0)
                {
                    Console.Write(a[i]+" ");
                }
            }
            Console.WriteLine();

        }

        static void a7()
        {
            int[] arr = { 66, 44, 35, 21, 5 };
            int[] arr2 = new int[arr.Length+1];
            Console.WriteLine("请插入一个数");
            int a = int.Parse(Console.ReadLine());
            for (int i = 0; i < arr.Length; i++)
            {
                arr2[i] = arr[i];
            }
            arr2[arr2.Length-1] = a;
            Array.Sort(arr2);
            Array.Reverse(arr2);
            foreach (var item in arr2)
            {
                Console.Write(item+"  ");
            }

        }
        
    }
}
